package com.qf.config;

import com.qf.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.config
 * @Description:
 * @Date 2022/6/30 21:05
 */
@Configuration
public class UserConfig {
    /**
     * tomcat启动就会自动加载执行这个方法,到spring容器中
     * @return
     */
    @Bean(name = "user1")
    public User user(){
        User user = new User();
        user.setId(1);
        user.setName("ddd");
        return  user;
    }

}
